import request from '@/utils/request'

// 查询盘点任务列表
export function listStocktakes(query) {
  return request({
    url: '/depot/stocktakes/list',
    method: 'get',
    params: query
  })
}

// 查询盘点任务详细
export function getStocktakes(stocktakeId) {
  return request({
    url: '/depot/stocktakes/' + stocktakeId,
    method: 'get'
  })
}

// 库存盘点中添加弹窗中用于查询产品信息
export function listSelectProduct(params) {
  return request({
    url: '/depot/stocktakes/productList',
    method: 'get',
    params: params
  })
}

// 新增盘点任务
export function addStocktakes(data) {
  return request({
    url: '/depot/stocktakes',
    method: 'post',
    data: data
  })
}

// 修改盘点任务
export function updateStocktakes(data) {
  return request({
    url: '/depot/stocktakes',
    method: 'put',
    data: data
  })
}

// 删除盘点任务
export function delStocktakes(stocktakeId) {
  return request({
    url: '/depot/stocktakes/' + stocktakeId,
    method: 'delete'
  })
}
